<?php
class site_dao_category extends ss_dao_category{
	/*
	public function getMasterData(){
		return array('name'=>$this->name(),'slug'=>$this->slug(),'entries'=>$this->entrysluglist(),'$ref'=>'/entry/'.$this->slug());
	}
	public function getDetailData(){
		return $this->getData();
	}
	
	public function entrysluglist(){
		if(is_null($this->entrysluglist)) return array();
		$entries=explode(',',$this->entrysluglist);
		foreach($entries as $slug){
			$result[$slug]=array('$ref'=>'/entry/'.$slug);
		}
		return $result;
	}
	*/
}

class hamilton_dao_category_mapper extends ss_dao_category_mapper{
	protected $table='category';
	protected $primary='idcategory';
	/*
	public function getActiveCategoryList(){
		$query=$this->injector->create('ss_dao_query');
		$sql=$query
		->from(array(
			'categoryActiveEntry'))
		->select();
		$stmt=$this->da->runStmt($sql);
		//ss_error::log($stmt->errorInfo(),'Info');
		return $this->getArray($stmt);
		//$result=$stmt->fetchObject('hamilton_dao_entry',array($this->primary));
	}
	
	private function getArray($stmt){
		$result=array();
		while($obj=$stmt->fetchObject('hamilton_dao_category',array($this->primary))){
			$result[]=$obj->clean();
		}
		$this->da->closeCursor($stmt);
		return $result;
	}
	
	public function query($q){
		$query=$this->injector->create('ss_dao_query');
		$sql=$query
		->from(array(
			'categorywithentries'))
		->where($q)
		->select();
		$stmt=$this->da->runStmt($sql,$query->values());
		return $this->getArray($stmt);
		
	}
	*/
}
?>